﻿<%@ Page Language="C#" MasterPageFile="~/Hero.master" Title="Home" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h1 class="mainTitle">Welcome!</h1>
<table >
<tr>
<td valign="top">
<h2 class="subTitle">Top scores</h2>
	
	<asp:ListView ID="lvTopResults" runat="server" DataSourceID="sdsTopResults">
		<LayoutTemplate>
			<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
		</LayoutTemplate>	
		<ItemTemplate>
		<div class="topResults">
			<p class="icon_user"><%# Eval("UserName")%></p>
			<p class="icon_artist"><%# Eval("Artist")%>: <%# Eval("Title")%></p>
			<p class="icon_score"><%# Eval("Score")%></p>
			<p class="icon_date"><%# Eval("PlayDate")%></p>
			<p class="icon_difficulty"><%# Eval("Difficulty")%></p>
		</div>
		</ItemTemplate>
		<AlternatingItemTemplate>
		  <div class="topResultsAlternate">
			<p class="icon_user_alt"><%# Eval("UserName")%></p>
			<p class="icon_artist_alt"><%# Eval("Artist")%>: <%# Eval("Title")%></p>
			<p class="icon_score_alt"><%# Eval("Score")%></p>
			<p class="icon_date_alt"><%# Eval("PlayDate")%></p>
			<p class="icon_difficulty_alt"><%# Eval("Difficulty")%></p>
		  </div>
		</AlternatingItemTemplate>	
	</asp:ListView>

	<asp:SqlDataSource ID="sdsTopResults" runat="server" 
		ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>" 
		SelectCommand="GetTopResults" SelectCommandType="StoredProcedure">
	</asp:SqlDataSource>
</td>
<td valign="top">

	<h2 class="subTitle">Last Comments</h2>
	
	<asp:ListView ID="lvLastComments" runat="server" DataSourceID="sdsLastComments">
		<LayoutTemplate>
			<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
		</LayoutTemplate>
		
		<ItemTemplate>
		<div class="topResults">
			<p class="icon_user"><%# Eval("UserName") %></p>
			<p class="icon_artist"><%# Eval("Artist") %>: <%# Eval("Title") %></p>
			<p class="icon_message"><%# Eval("Message") %> </p>
			<p class="icon_date"><%# Eval("CreatedDate") %></p>
		</div>
		</ItemTemplate>
		<AlternatingItemTemplate>
		<div class="topResultsAlternate">
			<p class="icon_user_alt"><%# Eval("UserName") %></p>
			<p class="icon_track_alt"><%# Eval("Artist") %>: <%# Eval("Title") %></p>
			<p class="icon_message_alt"><%# Eval("Message") %> </p>
			<p class="icon_date_alt"><%# Eval("CreatedDate") %></p>
		</div>
		</AlternatingItemTemplate>
		
	</asp:ListView>
</td></tr></table>
		<asp:SqlDataSource ID="sdsLastComments" runat="server" 
			ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>" 
			SelectCommand="GetLastComments" SelectCommandType="StoredProcedure"></asp:SqlDataSource>

</asp:Content>

